package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CheckItemDao {

    @Insert("insert into t_checkitem(code,name,sex,age,price,type,remark,attention) values (#{code},#{name},#{sex},#{age},#{price},#{type},#{remark},#{attention})")
    public void add(CheckItem checkItem);

    public Page<CheckItem> selectByCondition(String queryString);

    @Select("select count(*) from t_checkgroup_checkitem where checkitem_id = #{checkitem_id}")
    public long findCountCheckItemId(Integer id);

    @Delete("delete from t_checkitem where id=#{id}")
    public void deleteById(Integer id);

    public void edit(CheckItem checkItem);

    @Select("select * from t_checkitem where id=#{id}")
    public CheckItem findById(Integer id);

    @Select("select * from t_checkitem")
    public List<CheckItem> findAll();

}